import ast
from twisted.plugin import IPlugin
from dopplershift.core.plugins.interfaces import IDSPlugin
from zope.interface import implements
from dopplershift.core.containers.mediator import getMediator
class BackendsLoader(object):
    implements(IDSPlugin, IPlugin)
    application = 'backend.load'
    name = 'loader'
    def configure(self, config):
        self._config = config
        pf = getMediator().get('PluginsFactory')
        for el in config.get_list('plugin', 'backend.load'):
            if el[0] == self.name:continue
            if ast.literal_eval(el[1]):
                pf.build(el[0])
